//
//  Macro.h
//  shuai
//
//  Created by xingshuai on 2019/7/13.
//  Copyright © 2019 xingshuai. All rights reserved.
//

#ifndef Macro_h
#define Macro_h

#import <Foundation/Foundation.h>

#define KeyWindow [UIApplication sharedApplication].keyWindow    // KeyWindow
#define kWeakSelf(type)   __weak typeof(type) weak##type = type; // 弱引用
#define Defaults [NSUserDefaults standardUserDefaults]           // 轻量级缓存
static const float SVPROGRESSHUDTIME = 1.0;                     // SVProgressHUD的显示时间

/** 接口请求头地址 */
//static NSString *const shuai_baseUATURL = @"";    /** 正式站 */
static NSString* const shuai_baseUATURL = @"http://101.132.114.122:8099";      /** 测试站 */

/** 屏幕大小 */
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width              // 屏幕宽
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height            // 屏幕高
#define NEW_SCREEN_WIDTH(w) (SCREEN_WIDTH*(w)/375)
#define NEW_SCREEN_HEIGHT(w) (SCREEN_HEIGHT*(w)/667)

/** 常用颜色 */
#define WhiteColor   [UIColor whiteColor]                  // 白色
#define ClearColor   [UIColor clearColor]                  // 透明
#define RedColor     [UIColor redColor]                    // 红色
#define OrangeColor  [UIColor orangeColor]                 // 橙色
#define YellowColor  [UIColor yellowColor]                 // 黄色
#define GreenColor   [UIColor greenColor]                  // 绿色
#define BlackColor   [UIColor blackColor]                  // 黑色
#define GrayColor    [UIColor grayColor]                   // 灰色
#define BlueColor    [UIColor blueColor]                   // 蓝色
#define PurpleColor  [UIColor purpleColor]                 // 紫色
#define Color(r, g, b, a) [UIColor colorWithRed:r green:g blue:b alpha:a]                                // 背景色
#define ColorAlphe(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]   // 背景色

/** 常用字体大小设置 */
#define Font(x)           [UIFont systemFontOfSize:x]
#define FontCustom(x, y)  [UIFont systemFontOfSize:x weight:y]
#define HeiTiFont(x)      [UIFont fontWithName:@"Arial-BoldMT" size:x];

/** 导航高度和tabbar高度 */
#define rectOfStatusbar     [[UIApplication sharedApplication] statusBarFrame]   // 获取状态栏的frame
#define rectOfNavigationbar self.navigationController.navigationBar.frame        // 获取导航的frame
#define navCurentHeight     rectOfStatusbar.size.height+rectOfNavigationbar.size.height   // 获取页面头部到导航底部的高度
#define WD_TabBarHeight     ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49) //底部tabbar高度




#endif /* Macro_h */
